package com.boilermaker.springaoplearning.service;

import com.boilermaker.springaoplearning.handler.UserInvocationHandler;

import java.lang.reflect.Proxy;

public class Client {
    public static void main(String[] args) {
        UserService realUserService = new RealUserService();

        UserService proxy = (UserService) Proxy.newProxyInstance(
                realUserService.getClass().getClassLoader(),
                new Class[]{UserService.class},
                new UserInvocationHandler(realUserService)
        );

        proxy.queryUser("1010");
        proxy.deleteUser("1010");
    }
}
